﻿using System.Collections.Generic;
using System.Linq;
using ActivateYourGlutes.Model.Contracts;
using AutoMapper;

namespace ActivateYourGlutes.Model.Providers
{
    public class LookupProvider : ProviderBase, ILookupProvider
    {

        public LookupProvider(IEntityModelFactory factory)
            : base(factory)
        {
        }

        #region Implementation of ILookupProvider

        /// <summary>
        /// Returns the units of length that are setup in the system
        /// </summary>
        public IEnumerable<UnitOfLength> UnitsOfLength
        {
            get { return Mapper.Map<List<Internal.UnitOfLength>, List<UnitOfLength>>(Db.UnitOfLengthSet.ToList()); }
        }

        /// <summary>
        /// Returns the units of weight that are setup in the system
        /// </summary>
        public IEnumerable<UnitOfWeight> UnitsOfWeight
        {
            get { return Mapper.Map<List<Internal.UnitOfWeight>, List<UnitOfWeight>>(Db.UnitOfWeightSet.ToList()); }
        }

        #endregion
    }
}